<template>
    <el-tree :data="navData" :props="defaultProps" default-expand-all="true" @node-click="handleNodeClick"></el-tree>
</template>

<script>
    export default {
        props:['navData'],
        data() {
            return {
                defaultProps: {
                    children: 'children',
                    label: 'label'
                }
            };
        },
        methods: {
            handleNodeClick(data) {
                console.log(data);
                window.location.href="#"+data.label
            }
        }
    };
</script>